/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wicketsystem;

/**
 *
 * @author Daryna_Ragimova
 */
public class QuantityOfTripsCard implements Card {

    protected int id;
    private final Types type;
    private int quantityOfTrips;

    public QuantityOfTripsCard(int id, int quantityOfTrips) {
        this.id = id;
        this.quantityOfTrips = quantityOfTrips;
        this.type = Types.TripsQuantity;
    }

    public Types getType() {
        return type;
    }


       
    public int getQuantityOfTrips() {
        return quantityOfTrips;
    }
    
    @Override
    public boolean check() {
        if (quantityOfTrips > 0) {
            return true;
        }
        return false;

    }

    @Override
    public boolean getTrip() {
        if (check()) {
            quantityOfTrips--;
            return true;
        }
        return false;
    }
}
